using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.UI;

public class Job710GameMgr : MonoBehaviour
{
    Job710FsmMgr fsmMgr;
    public Dropdown dropdown;
    // Start is called before the first frame update
    void Start()
    {
        fsmMgr = new Job710FsmMgr();
        fsmMgr.AddWeapon(ENUM_Weapon.Gun, new Job710Gun());
        fsmMgr.AddWeapon(ENUM_Weapon.Sword, new Job710Sword());
        fsmMgr.AddWeapon(ENUM_Weapon.shotgun, new Job710Shotgun());

        dropdown.ClearOptions();
        dropdown.AddOptions(Enum.GetNames(typeof(ENUM_Weapon)).ToList());
        dropdown.onValueChanged.AddListener(OnDropdownValueChanged);

        fsmMgr.SetWeapon((ENUM_Weapon)0);
    }

    private void OnDropdownValueChanged(int arg0)
    {
        //dropdown.captionText.text = dropdown.options[arg0].text;

        fsmMgr.SetWeapon((ENUM_Weapon)arg0);
    }

    // Update is called once per frame
    void Update()
    {

    }
    public void AtkBut()
    {
        fsmMgr.Atk();
    }
}
